package session1.examples.chap2;

public class Eg2 {
	public static void main(String[] args) {
		new Thread(new PrimarySchoolStudent("Jim")).start();
	}
}
class PrimarySchoolStudent extends Stu implements Runnable{
	public PrimarySchoolStudent(String name) {
		super(name);
	}
	@Override
	public void run() {
		System.out.println("I am a primary school student");
		System.out.println("I can calculate:");
		System.out.print("1+...+100=");
		for(int i=0,sum=0;;i++,sum+=i) {
			if (i == 100) System.out.println(sum);
			else continue;
			break;
		}
	}
}
class Stu{
	String name;
	public Stu(String name) {
		this.name = name;
	}
	public void introduce(){
		System.out.println("My name is"+name);
	}
}
